"""
@File    :   models.py
@Time    :   2024/02/07 10:09:46
@Author  :   Qrj
@Email   :   923207736@qq.com
@description   :   全局数据模型相关
"""

from sqlalchemy.orm import declarative_base

# from sqlalchemy import MetaData

# 显式设置索引命名
# 可用于避免多个外键指向同一个模型时需要手动指定外键的name
# POSTGRES_INDEXES_NAMING_CONVENTION = {
#     "ix": "%(column_0_label)s_idx",
#     "uq": "%(table_name)s_%(column_0_name)s_key",
#     "ck": "%(table_name)s_%(constraint_name)s_check",
#     "fk": "%(table_name)s_%(column_0_name)s_fkey",
#     "pk": "%(table_name)s_pkey",
# }

# 创建自定义元数据
# metadata = MetaData(naming_convention=POSTGRES_INDEXES_NAMING_CONVENTION)

# 创建ORM模型基类(用于构建ORM模型)
# OrmBase = declarative_base(metadata=metadata)
OrmBase = declarative_base()
